package com.hsogoo.study.externalizedconfiguration;

import com.hsogoo.study.externalizedconfiguration.bean.Person;
import com.hsogoo.study.externalizedconfiguration.config.PersonConfiguration;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @Author huangsaigang
 * Created @2019-09-29.
 */
@Configuration
@Import(PersonConfiguration.class)
public class ExternalizedConfigurationApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder(ExternalizedConfigurationApplication.class)
                .web(WebApplicationType.NONE)
                .run(args);

        Person person = context.getBean("person", Person.class);
        System.err.println(person);

        context.close();

    }
}
